import store from "@/store";

// 使用mixin技术来混入对象
const permissionMixin = {
   methods: {
      // key是权限点  根据权限点判断当前用户是否拥有权限
      checkPermission(key) {  //权限点 ==> points
         return store.state.user?.userInfo?.roles?.points?.includes(key)
      }
   }
}

export default {
   install(Vue) {
      Vue.mixin(permissionMixin)
   }
}

